package com.jeff.tianti.cms.service;

import com.jeff.tianti.cms.dao.AdvSpaceDao;
import com.jeff.tianti.cms.dao.CertificateDao;
import com.jeff.tianti.cms.dto.AdvSpaceQueryDTO;
import com.jeff.tianti.cms.dto.CertificateQueryDTO;
import com.jeff.tianti.cms.entity.AdvSpace;
import com.jeff.tianti.cms.entity.Certificate;
import com.jeff.tianti.common.entity.PageModel;
import com.jeff.tianti.common.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CertificateService extends CommonService<Certificate, String> {
    @Autowired
    private CertificateDao certificateDao;

    @Autowired
    public void setCertificateDao(CertificateDao certificateDao){
        super.setCommonDao(certificateDao);
    }

    public PageModel<Certificate> queryCertificatePage(CertificateQueryDTO certificateQueryDTO){
        return this.certificateDao.queryCertificatePage(certificateQueryDTO);
    }
    public int updateSelective(Certificate certificate) {
        return  certificateDao.updateSelectiveById(certificate);
    }

    public Certificate findByColumnIdAndNumber(CertificateQueryDTO certificate) {
        return  certificateDao.findByColumnIdAndNumber(certificate.getColumnId(),certificate.getNumber());
    }
}
